
/**
 * Initialize the controllers of the application.
 * @author eKameleon
 */
if ( ewhiteboard.application.ControllerEngine == undefined ) 
{

	/**
	 * Creates a the ControllerEngine singleton reference.
	 */
	ewhiteboard.application.ControllerEngine = {}
	
	/**
	 * Initialize the frontcontroller of the application.
	 */
	ewhiteboard.application.ControllerEngine.initialize = function () /*void*/
	{

		var ApplicationEvent = asgard.events.ApplicationEvent ;
		var Delegate         = vegas.events.Delegate ;

		var controller /*FrontController*/ = vegas.events.FrontController.getInstance() ;
		
		asgard.GATEWAY.setController( controller ) ;
		
		// controller.application
				
		controller.insert( ApplicationEvent.ACCEPT     , new ewhiteboard.controller.application.AcceptApplication() ) ;
		controller.insert( ApplicationEvent.CONNECT    , new ewhiteboard.controller.application.ConnectApplication() ) ;
		controller.insert( ApplicationEvent.DISCONNECT , new ewhiteboard.controller.application.DisconnectApplication() ) ;
		controller.insert( ApplicationEvent.REJECT     , new ewhiteboard.controller.application.RejectApplication() ) ;
		controller.insert( ApplicationEvent.START      , new ewhiteboard.controller.application.StartApplication() ) ;
		controller.insert( ApplicationEvent.STOP       , new ewhiteboard.controller.application.StopApplication() ) ;	
		
	}

}